package com.example.service.impl;

import com.example.service.ProductClient;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

@Service
public class ProductFallBack implements ProductClient {
    @Override
    public String getPro(Integer proId) {
        return "本地兜底方法,当前商品id为"+proId;
    }

    @Override
    public String getAllPro() {
        return "本地兜底方法,请稍后再试（查询所有商品）";
    }

    @Override
    public Map getProPrice(Integer proId) {
        System.out.println("当前无法查询商品价格");
        Map<String,Object> price=new HashMap<>();
        price.put("proPrice",null);
        return price;
    }
}
